{
 "cells": [
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# HHL 算法原理"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "原论文链接：[Quantum Algorithm for Linear Systems of Equations](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.103.150502)\n",
    "\n",
    "**HHL算法的目的：** 给定一个 Hermitian $A$ 和一个单位向量 $\\vec{b}$，\n",
    "求解方程 $A \\vec{x} = \\vec{b}$ 。\n",
    "\n",
    "令 $\\left| b  \\right\\rangle = \\sum_{j=1}^{N} b_{j } \\left| j   \\right\\rangle$， \n",
    "算法的关键在于在 $\\left|b \\right\\rangle$ 上模拟 $e^{i A \\Delta t }$ 。\n",
    "\n",
    "设 $A$ 的谱分解如下 \n",
    "$$A = \\sum_{j=1}^{N} \\lambda_{j } \\left| u_{j} \\right\\rangle \\left\\langle u_{j} \\right|$$\n",
    "那么 \n",
    "$$e^{i A \\Delta t } = \\sum_{j=1}^{N} e^{i \\lambda_{j} \\Delta t } \\left| u_{j} \\right\\rangle \\left\\langle u_{j} \\right|$$\n",
    "\n",
    "将 $\\left| b  \\right\\rangle$ 用基 $\\left\\lbrace \\left| u_{j} \\right\\rangle \\right\\rbrace$ 表示 ： $\\left| b  \\right\\rangle = \\sum_{j=1}^{N} \\beta_{j} \\left| u_{j} \\right\\rangle$ 。\n",
    "\n",
    "使用量子相位估计 QPE（Quantum Phase Estimation），其中 $U = e^{i A \\Delta t}$，作用结果如下：\n",
    "$$\\left| b  \\right\\rangle \\xrightarrow{\\text{QPE}} \\sum_{j=1}^{N} \\beta_{j} \\left| u_{j} \\right\\rangle | \\widetilde{ \\lambda_j } \\rangle$$\n",
    "其中 $| \\widetilde{\\lambda_j} \\rangle$ 是特征值 $\\lambda_{j}$ 的估计（波浪线表示估计值，下文同理）。\n",
    "\n",
    "很容易看出方程的解就是 \n",
    "$$\n",
    "\\left| x  \\right\\rangle = A^{-1 } \\left| b  \\right\\rangle = \\sum_{j}^{ } \\beta_{j } (\\lambda_{j})^{-1 } \\left| u_{j} \\right\\rangle\n",
    "$$\n",
    "所以我们只需要将信息从量子态 $| \\widetilde{\\lambda_j} \\rangle$ 中提取出来即可。\n",
    "\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# HHL 算法步骤\n",
    "\n",
    "下面详细介绍 HHL 算法的详细步骤，包含详细的数学推导。"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 数据预处理\n",
    "\n",
    "前面提到 $A$ 需要是 Hermitian 的，也就是 $A^\\dagger = A$。其实这个条件可以放宽，如果 $A$ 不是 Hermitian 的，构造 $\\tilde{A}$ 如下：\n",
    "$$\n",
    "\\tilde{A} = \\begin{pmatrix}\n",
    "0 & A \\\\\n",
    "A^{\\dagger } & 0 \\\\\n",
    "\\end{pmatrix}\n",
    "$$\n",
    "\n",
    "然后求解方程\n",
    "$$\n",
    "\\tilde{A} \\vec{y} = \\begin{pmatrix}\n",
    "\\vec{b} \\\\\n",
    "0 \\\\\n",
    "\\end{pmatrix}\n",
    "$$\n",
    "\n",
    "很容易验证方程的解 $\\vec{y}$ 一定具有如下的形式 \n",
    "$$\n",
    "\\vec{y} = \\begin{pmatrix}\n",
    "0 \\\\\n",
    "\\vec{x} \\\\\n",
    "\\end{pmatrix}\n",
    "$$\n",
    "其中 $A \\vec{x} = \\vec{b}$ 。\n",
    "\n",
    "对于 $\\vec{b}$，因为 HHL 是量子算法，所以需要输入的是量子态 $|b\\rangle = \\sum_{j=1}^N b_j |j\\rangle$ 。关于如何制备这样量子态，如何将经典信息编码到量子信息，不是本算法关心的重点，这里只假设制备好了这样的量子态。"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 制备算子 $U = e^{i A \\Delta t}$\n",
    "\n",
    "如何高效的制备算子 $U = e^{i A \\Delta t}$ 是核心问题。后面将会看到，整个 HHL 算法的复杂度主要取决于算子 $U$ ，所以需要高效的模拟 $U$ 。\n",
    "\n",
    "制备这个时间演化算子 $U = e^{i A \\Delta t}$ 属于量子系统模拟（哈密顿量模拟）问题，本身是一个重要的量子问题，这里并不展开讨论。\n",
    "\n",
    "在原论文中，对矩阵 $A$ 作出了**稀疏性**的限制，其目的就是能够高效的模拟 $e^{i A \\Delta t}$。对于一般的稠密矩阵 $A$，模拟其演化复杂度可能很高。"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 量子相位估计 QPE\n",
    "\n",
    "这里不去展开证明 QPE 的正确性，读者只需要知道 QPE 的输入是一个酉算子 $U$ 和其特征向量 $|u\\rangle$，设 $U |u\\rangle = e^{2 \\pi i \\varphi} |u\\rangle$ ，输出是 $\\varphi$ 的估计 $\\tilde{\\varphi}$ 。\n",
    "\n",
    "具体来说，使用 $t$ 个辅助量子比特, QPE 的作用如下 \n",
    "$$\\left| b  \\right\\rangle \\left| 0 \\right\\rangle^{\\otimes t} \\left| 0 \\right\\rangle = \\sum_{j=1}^{N} \\beta_{j} \\left| u_{j} \\right\\rangle \\left| 0 \\right\\rangle^{\\otimes t} \\left| 0 \\right\\rangle \n",
    "\\xrightarrow{\\text{QPE}} \\sum_{j=1}^{N} \\beta_{j} \\left| u_{j} \\right\\rangle \\left| \\widetilde{\\varphi_j} \\right\\rangle \\left| 0 \\right\\rangle$$\n",
    "其中 $\\left| \\widetilde{\\varphi_j} \\right\\rangle$ 是相位 $\\varphi_{j}$ 的估计。\n",
    "这里在 $t$ 个辅助比特后面还增加了一个辅助比特，是用于后面的旋转步骤。 \n",
    "\n",
    "为了更好的理解，这里举一个例子： \n",
    "取 \n",
    "$$A = Z = \\left| 0 \\right\\rangle \\left\\langle 0 \\right| - \\left| 1 \\right\\rangle \\left\\langle 1 \\right|$$\n",
    "那么 \n",
    "$$U = e^{i A \\Delta t } = e^{i \\Delta t} \\left| 0 \\right\\rangle \\left\\langle 0 \\right| + e^{-i \\Delta t} \\left| 1 \\right\\rangle \\left\\langle 1 \\right|$$\n",
    "两个相位分别是 $\\varphi_{1} = \\Delta t / 2 \\pi$ 和 $\\varphi_{2} = -\\Delta t / 2 \\pi$ 。\n",
    "\n",
    "如果我们使用 $t = 4$ 个辅助比特，并且取 $\\Delta t = \\pi / 4$，那么 $\\varphi_{1} = 1 / 8$ 和 $\\varphi_{2} = - 1 / 8$ 。 \n",
    "\n",
    "两个相位的估计值分别是 $\\widetilde{\\varphi_1} = 0.0010 \\times 2^4 = 2$ 和 $\\widetilde{\\varphi_2} = 0.1110 \\times 2^4 = 14$ 。\n",
    "因为相位是 $[0, 1)$ 之间的小数 $0.q_{t_1}q_{t_2}\\ldots q_{t_t}$，\n",
    "乘上 $2^t$ 得到其对应的量子态 $|q_{t_1} \\ldots q_{t_t} \\rangle$ 。\n",
    "需要指出的是，因为相位是模 $1$ 的小数，$-0.0010$ 被映射到了 $0.1110$，我们想要还原相位（为了还原 $\\lambda$），首先通过选取足够小的 $\\Delta t$ 使得 $|\\varphi| < 1 / 2$，这样如果 $|q_{t_1} \\ldots q_{t_t}\\rangle < 2^{t-1}$ 对应正数，$|q_{t_1}\\ldots q_{t_t}\\rangle > 2^{t-1}$ 对应负数。\n",
    "\n",
    "通过简单的定量计算，我们得到如下的映射关系： \n",
    "$$\n",
    "\\frac{\\lambda \\Delta t}{2 \\pi} =   \\varphi = \\begin{cases}\n",
    "\\tilde{\\varphi} / 2^{t} &  , \\varphi > 0 & , \\tilde{\\varphi} < 2^{t-1} \\\\\n",
    "\\tilde{\\varphi} / 2^{t} - 1 & , \\varphi < 0 & , \\tilde{\\varphi} > 2^{t-1}\\\\\n",
    "\\end{cases}\n",
    "$$\n",
    "其中 $\\lambda$ 是 $A$ 的特征值，$\\varphi$ 是 $U = e^{i A \\Delta t}$ 的相位，$\\tilde{\\varphi}$ 是 $\\varphi$ 的估计。\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 条件旋转\n",
    "\n",
    "经过 QPE 后，整个量子态如下\n",
    "$$\n",
    "\\sum_{j=1}^{N} \\beta_{j} \\left| u_{j} \\right\\rangle \\left| \\widetilde{\\varphi_j} \\right\\rangle \\left| 0 \\right\\rangle\n",
    "$$\n",
    "\n",
    "想要将 $\\lambda_j$ 的信息从量子态 $\\left| \\widetilde{\\varphi_j} \\right\\rangle$ 中提取出来， 我们需要使用条件旋转门 $CR(k)$， 其作用效果如下 \n",
    "$$\n",
    "CR(k) \\left| \\tilde{\\varphi} \\right\\rangle \\left| b \\right\\rangle = \\begin{cases}\n",
    "\\left| \\tilde{\\varphi} \\right\\rangle \\left| b \\right\\rangle & ,  k \\neq \\tilde{\\varphi}  \\\\\n",
    "\\left| \\tilde{\\varphi} \\right\\rangle R_y \\left( 2 \\arcsin \\frac{C}{\\lambda} \\right) \\left| b \\right\\rangle & , k = \\tilde{\\varphi} \\\\\n",
    "\\end{cases}\n",
    "$$\n",
    "简单来说，只有当 $k$ 选择了正确的 $\\tilde{\\varphi}$，才会对后面的量子比特作用旋转操作。\n",
    "\n",
    "因为我们不知道正确的 $\\tilde{\\varphi}$ 是什么，所以暴力的枚举所有的可能 $CR(k)$， $k = 1, \\ldots , 2^{t}-1$ 。 \n",
    "\n",
    "旋转的效果是很简单的\n",
    "$$\n",
    "\\prod_{k=1}^{2^{t} - 1} I\\otimes CR(k) \\sum_{j=1}^{N} \\beta_{j} \\left| u_{j} \\right\\rangle \\left| \\widetilde{\\varphi_j} \\right\\rangle \\left| 0 \\right\\rangle\n",
    "= \\sum_{j=1}^{N} \\beta_{j} \\left| u_{j} \\right\\rangle \\left| \\widetilde{\\varphi_j} \\right\\rangle \\left( \\sqrt{1 - \\left( \\frac{C}{\\lambda_{j}} \\right)^{2}} \\left| 0 \\right\\rangle + \\frac{C}{\\lambda_{j}} \\left| 1 \\right\\rangle \\right)\n",
    "$$\n",
    "\n",
    "再作用一次逆 QPE，整体的量子态如下 \n",
    "$$\n",
    "\\left| \\psi \\right\\rangle = \\sum_{j=1}^{N} \\beta_{j} \\left| u_{j} \\right\\rangle \\left| 0 \\right\\rangle^{\\otimes t} \\left( \\sqrt{1 - \\left( \\frac{C}{\\lambda_{j}} \\right)^{2}} \\left| 0 \\right\\rangle + \\frac{C}{\\lambda_{j}} \\left| 1 \\right\\rangle \\right)\n",
    "$$\n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 测量\n",
    "\n",
    "对最后一个量子比特进行测量， 当测量结果是 $\\left| 1 \\right\\rangle$ 时， 其概率是\n",
    "$$\n",
    "p_1 = C^{2} \\sum_{j=1}^{N} ( \\beta_{j} / \\lambda_{j} )^{2} \n",
    "$$\n",
    "\n",
    "测量后的量子态变为 \n",
    "$$\n",
    "\\left| \\psi_{1} \\right\\rangle = \\frac{1}{\\left( \\sum_{j=1}^{N} \\left( \\beta_{j} / \\lambda_{j} \\right)^{2} \\right)^{-1}} \\sum_{j=1}^{N} \\frac{\\beta_{j}}{\\lambda_{j}} \\left| u_{j} \\right\\rangle \\left| 0 \\right\\rangle^{\\otimes t} \\left| 1 \\right\\rangle\n",
    "$$\n",
    "\n",
    "显然此时三个量子寄存器之间不存在纠缠，如果只看第一个量子寄存器，它已经是 $|x\\rangle$ 的状态了（忽略掉一个归一化系数）。\n",
    "\n",
    "需要指出的是，旋转操作里面有一个参数 $C$， 我们看到 $C$ 不会影响最后结果的正确性， 但是却实实在在的影响了得到结果的概率 $p_{1}$ 。\n",
    "我们肯定希望 $C$ 能够尽可能大，从而使 $p_1$ 尽可能大。但是 $C \\leq \\left\\vert \\lambda_{j} \\right\\vert$ ，它要比所有特征值的绝对值还要小，如果没有先验信息，不知道绝对值最小的 $\\lambda$ 有多大，那么就只能保守的取一个很小的 $C$，然后可以通过振幅放大技术来增大得到结果的概率。 \n"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# MindQuantum 实现\n",
    "\n",
    "这里使用 MindQuantum 实现一个简单的例子，仅说明 HHL 算法的过程和正确性。\n",
    "\n",
    "为了计算方便，我们选取一个简单的 \n",
    "$A = Z = \\begin{bmatrix}\n",
    "1 & 0 \\\\\n",
    "0 & -1\n",
    "\\end{bmatrix}$，因为其时间演化算子 $e^{i Z \\Delta t} = R_z(- 2 \\Delta t)$ ，比较容易实现。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "eigenvalues of A:\n",
      " [ 1. -1.]\n",
      "eigenvectors of A:\n",
      " [[1. 0.]\n",
      " [0. 1.]]\n",
      "b: [0.6 0.8]\n",
      "Solution of Ax=b is: [ 0.6 -0.8]\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "A = np.array([[1, 0], [0, -1]])\n",
    "es, vs = np.linalg.eig(A)\n",
    "\n",
    "print(f\"eigenvalues of A:\\n {es}\")\n",
    "print(f\"eigenvectors of A:\\n {vs}\")\n",
    "\n",
    "b = np.array([0.6, 0.8])\n",
    "print(f\"b: {b}\")\n",
    "print(f\"Solution of Ax=b is: {np.linalg.solve(A, b)}\")"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "这里导入所需要的各种函数："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from mindquantum.core.operators import QubitOperator, Hamiltonian, TimeEvolution\n",
    "from mindquantum.core.gates import H, X, RX, RY, RZ, Measure, Power, BARRIER\n",
    "from mindquantum.core.circuit import Circuit, UN\n",
    "from mindquantum.simulator import Simulator"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "对于量子态 $|b\\rangle = \\cos\\theta |0\\rangle + \\sin\\theta |1\\rangle$ 的制备，可以通过一个 $R_y(2 \\theta)$ 实现。\n",
    "\n",
    "下面的代码制备了 $|b\\rangle = 0.6 |0\\rangle + 0.8 |1\\rangle$ 并进行了测量。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space: pre;\"><span style=\"color: #808000; text-decoration-color: #808000\">shots: </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">10000</span>\n",
       "<span style=\"color: #808000; text-decoration-color: #808000\">Keys: q0│</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.00</span><span style=\"color: #808000; text-decoration-color: #808000\">   </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.161</span><span style=\"color: #808000; text-decoration-color: #808000\">       </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.322</span><span style=\"color: #808000; text-decoration-color: #808000\">       </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.483</span><span style=\"color: #808000; text-decoration-color: #808000\">       </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.644</span><span style=\"color: #808000; text-decoration-color: #808000\">       </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.805</span>\n",
       "<span style=\"color: #808000; text-decoration-color: #808000\">────────┼───────────┴───────────┴───────────┴───────────┴───────────┴</span>\n",
       "<span style=\"color: #808000; text-decoration-color: #808000\">       </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span><span style=\"color: #808000; text-decoration-color: #808000\">│▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒</span>\n",
       "<span style=\"color: #808000; text-decoration-color: #808000\">        │</span>\n",
       "<span style=\"color: #808000; text-decoration-color: #808000\">       </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span><span style=\"color: #808000; text-decoration-color: #808000\">│▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓</span>\n",
       "<span style=\"color: #808000; text-decoration-color: #808000\">        │</span>\n",
       "<span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">{</span><span style=\"color: #008000; text-decoration-color: #008000\">'0'</span><span style=\"color: #808000; text-decoration-color: #808000\">: </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3556</span><span style=\"color: #808000; text-decoration-color: #808000\">, </span><span style=\"color: #008000; text-decoration-color: #008000\">'1'</span><span style=\"color: #808000; text-decoration-color: #808000\">: </span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">6444</span><span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">}</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "shots: 10000\n",
       "Keys: q0│0.00   0.161       0.322       0.483       0.644       0.805\n",
       "────────┼───────────┴───────────┴───────────┴───────────┴───────────┴\n",
       "       0│▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒\n",
       "        │\n",
       "       1│▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓\n",
       "        │\n",
       "{'0': 3556, '1': 6444}"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "circ = Circuit()\n",
    "circ += RY(2 * np.arcsin(0.8)).on(0)\n",
    "circ += Measure().on(0)\n",
    "\n",
    "sim = Simulator(backend=\"mqvector\", n_qubits=1)\n",
    "sim.sampling(circ, shots=10000)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "下面一步步构建出完整的量子线路，取 $t = 4$，$\\Delta t = \\pi / 4$， $C = 0.5$。\n",
    "- 首先是 QPE\n",
    "- 然后是 $CR(k)$，$k = 1, \\ldots, 15$\n",
    "- 接着是 逆QPE\n",
    "- 最后测量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<div class=\"nb-html-output output_area\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"6016.8\" height=\"380.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<rect x=\"0\" y=\"0.0\" width=\"6016.8\" height=\"380.0\" fill=\"#ffffff\" />\n",
       "<text x=\"20.0\" y=\"40.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >\n",
       "q0:\n",
       " </text>\n",
       "<text x=\"20.0\" y=\"100.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >\n",
       "q1:\n",
       " </text>\n",
       "<text x=\"20.0\" y=\"160.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >\n",
       "q2:\n",
       " </text>\n",
       "<text x=\"20.0\" y=\"220.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >\n",
       "q3:\n",
       " </text>\n",
       "<text x=\"20.0\" y=\"280.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >\n",
       "q4:\n",
       " </text>\n",
       "<text x=\"20.0\" y=\"340.0\" font-size=\"16px\" dominant-baseline=\"middle\" text-anchor=\"start\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#252b3a\" >\n",
       "q5:\n",
       " </text>\n",
       "<line x1=\"48.8\" x2=\"5996.8\" y1=\"40.0\" y2=\"40.0\" stroke=\"#adb0b8\" stroke-width=\"1\" />\n",
       "<line x1=\"48.8\" x2=\"5996.8\" y1=\"100.0\" y2=\"100.0\" stroke=\"#adb0b8\" stroke-width=\"1\" />\n",
       "<line x1=\"48.8\" x2=\"5996.8\" y1=\"160.0\" y2=\"160.0\" stroke=\"#adb0b8\" stroke-width=\"1\" />\n",
       "<line x1=\"48.8\" x2=\"5996.8\" y1=\"220.0\" y2=\"220.0\" stroke=\"#adb0b8\" stroke-width=\"1\" />\n",
       "<line x1=\"48.8\" x2=\"5996.8\" y1=\"280.0\" y2=\"280.0\" stroke=\"#adb0b8\" stroke-width=\"1\" />\n",
       "<line x1=\"48.8\" x2=\"5996.8\" y1=\"340.0\" y2=\"340.0\" stroke=\"#adb0b8\" stroke-width=\"1\" />\n",
       "\n",
       "<rect x=\"72.8\" y=\"320.0\" width=\"80.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"112.8\" y=\"336.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RY\n",
       " </text>\n",
       "<text x=\"112.8\" y=\"352.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "1.8546\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"72.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"92.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "H\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"72.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"92.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "H\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"72.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"92.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "H\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"72.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"92.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "H\n",
       " </text>\n",
       "\n",
       "<circle cx=\"252.8\" cy=\"280.0\" r=\"4\" fill=\"#5e7ce0\" />\n",
       "<line x1=\"252.8\" x2=\"252.8\" y1=\"280.0\" y2=\"340.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" />\n",
       "<rect x=\"172.8\" y=\"320.0\" width=\"160.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"252.8\" y=\"340.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RZ(-π/2)^1\n",
       " </text>\n",
       "\n",
       "<circle cx=\"432.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" />\n",
       "<line x1=\"432.8\" x2=\"432.8\" y1=\"220.0\" y2=\"340.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" />\n",
       "<rect x=\"352.8\" y=\"320.0\" width=\"160.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"432.8\" y=\"340.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RZ(-π/2)^2\n",
       " </text>\n",
       "\n",
       "<circle cx=\"612.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" />\n",
       "<line x1=\"612.8\" x2=\"612.8\" y1=\"160.0\" y2=\"340.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" />\n",
       "<rect x=\"532.8\" y=\"320.0\" width=\"160.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"612.8\" y=\"340.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RZ(-π/2)^4\n",
       " </text>\n",
       "\n",
       "<circle cx=\"792.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" />\n",
       "<line x1=\"792.8\" x2=\"792.8\" y1=\"100.0\" y2=\"340.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" />\n",
       "<rect x=\"712.8\" y=\"320.0\" width=\"160.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"792.8\" y=\"340.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RZ(-π/2)^8\n",
       " </text>\n",
       "\n",
       "<line x1=\"912.8\" x2=\"912.8\" y1=\"140.0\" y2=\"240.0\" stroke-width=\"3\" stroke=\"#16acff\" />\n",
       "\n",
       "<rect x=\"892.8\" y=\"140.0\" width=\"40\" height=\"40\" rx=\"4\" ry=\"4\" fill=\"#16acff\" fill-opacity=\"1\" stroke=\"#ffffff\" stroke-width=\"0\" />\n",
       "<path d=\"M 903.1999999999999 156.31384387633062 L 908.0 148.0 L 912.8 156.31384387633062 L 909.4399999999999 156.31384387633062 L 909.4399999999999 172.0 L 906.56 172.0 L 906.56 156.31384387633062 Z\" fill=\"#ffffff\" />\n",
       "<path d=\"M 922.4 163.68615612366938 L 917.5999999999999 172.0 L 912.8 163.68615612366938 L 916.16 163.68615612366938 L 916.16 148.0 L 919.04 148.0 L 919.04 163.68615612366938 Z\" fill=\"#ffffff\" />\n",
       "<rect x=\"892.8\" y=\"200.0\" width=\"40\" height=\"40\" rx=\"4\" ry=\"4\" fill=\"#16acff\" fill-opacity=\"1\" stroke=\"#ffffff\" stroke-width=\"0\" />\n",
       "<path d=\"M 903.1999999999999 216.31384387633062 L 908.0 208.0 L 912.8 216.31384387633062 L 909.4399999999999 216.31384387633062 L 909.4399999999999 232.0 L 906.56 232.0 L 906.56 216.31384387633062 Z\" fill=\"#ffffff\" />\n",
       "<path d=\"M 922.4 223.68615612366938 L 917.5999999999999 232.0 L 912.8 223.68615612366938 L 916.16 223.68615612366938 L 916.16 208.0 L 919.04 208.0 L 919.04 223.68615612366938 Z\" fill=\"#ffffff\" />\n",
       "<line x1=\"972.8\" x2=\"972.8\" y1=\"80.0\" y2=\"300.0\" stroke-width=\"3\" stroke=\"#16acff\" />\n",
       "\n",
       "<rect x=\"952.8\" y=\"80.0\" width=\"40\" height=\"40\" rx=\"4\" ry=\"4\" fill=\"#16acff\" fill-opacity=\"1\" stroke=\"#ffffff\" stroke-width=\"0\" />\n",
       "<path d=\"M 963.1999999999999 96.31384387633061 L 968.0 88.0 L 972.8 96.31384387633061 L 969.4399999999999 96.31384387633061 L 969.4399999999999 112.0 L 966.56 112.0 L 966.56 96.31384387633061 Z\" fill=\"#ffffff\" />\n",
       "<path d=\"M 982.4 103.68615612366939 L 977.5999999999999 112.0 L 972.8 103.68615612366939 L 976.16 103.68615612366939 L 976.16 88.0 L 979.04 88.0 L 979.04 103.68615612366939 Z\" fill=\"#ffffff\" />\n",
       "<rect x=\"952.8\" y=\"260.0\" width=\"40\" height=\"40\" rx=\"4\" ry=\"4\" fill=\"#16acff\" fill-opacity=\"1\" stroke=\"#ffffff\" stroke-width=\"0\" />\n",
       "<path d=\"M 963.1999999999999 276.3138438763306 L 968.0 268.0 L 972.8 276.3138438763306 L 969.4399999999999 276.3138438763306 L 969.4399999999999 292.0 L 966.56 292.0 L 966.56 276.3138438763306 Z\" fill=\"#ffffff\" />\n",
       "<path d=\"M 982.4 283.6861561236694 L 977.5999999999999 292.0 L 972.8 283.6861561236694 L 976.16 283.6861561236694 L 976.16 268.0 L 979.04 268.0 L 979.04 283.6861561236694 Z\" fill=\"#ffffff\" />\n",
       "\n",
       "<rect x=\"1012.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"1032.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "H\n",
       " </text>\n",
       "\n",
       "<circle cx=\"1092.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"1092.8\" x2=\"1092.8\" y1=\"220.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"1072.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"1092.8\" y=\"216.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "PS\n",
       " </text>\n",
       "<text x=\"1092.8\" y=\"232.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "-π/2\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"1132.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"1152.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "H\n",
       " </text>\n",
       "\n",
       "<circle cx=\"1212.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"1212.8\" x2=\"1212.8\" y1=\"160.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"1192.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"1212.8\" y=\"156.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "PS\n",
       " </text>\n",
       "<text x=\"1212.8\" y=\"172.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "-π/4\n",
       " </text>\n",
       "\n",
       "<circle cx=\"1272.8\" cy=\"220.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"1272.8\" x2=\"1272.8\" y1=\"160.0\" y2=\"220.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"1252.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"1272.8\" y=\"156.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "PS\n",
       " </text>\n",
       "<text x=\"1272.8\" y=\"172.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "-π/2\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"1312.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"1332.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "H\n",
       " </text>\n",
       "\n",
       "<circle cx=\"1392.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"1392.8\" x2=\"1392.8\" y1=\"100.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"1372.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"1392.8\" y=\"96.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "PS\n",
       " </text>\n",
       "<text x=\"1392.8\" y=\"112.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "-π/8\n",
       " </text>\n",
       "\n",
       "<circle cx=\"1452.8\" cy=\"220.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"1452.8\" x2=\"1452.8\" y1=\"100.0\" y2=\"220.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"1432.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"1452.8\" y=\"96.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "PS\n",
       " </text>\n",
       "<text x=\"1452.8\" y=\"112.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "-π/4\n",
       " </text>\n",
       "\n",
       "<circle cx=\"1512.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"1512.8\" x2=\"1512.8\" y1=\"100.0\" y2=\"160.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"1492.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"1512.8\" y=\"96.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "PS\n",
       " </text>\n",
       "<text x=\"1512.8\" y=\"112.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "-π/2\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"1552.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"1572.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "H\n",
       " </text>\n",
       "\n",
       "<rect x=\"1612.8\" y=\"20.0\" width=\"0\" height=\"340\" fill=\"gray\" fill-opacity=\"0.8\" />\n",
       "\n",
       "<rect x=\"1612.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"1632.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"1612.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"1632.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"1612.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"1632.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<circle cx=\"1692.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"1692.8\" cy=\"220.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"1692.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"1692.8\" cy=\"100.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"1692.8\" x2=\"1692.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"1672.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"1692.8\" y=\"36.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RY\n",
       " </text>\n",
       "<text x=\"1692.8\" y=\"52.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "π\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"1732.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"1752.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"1732.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"1752.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"1732.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"1752.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<rect x=\"1792.8\" y=\"20.0\" width=\"0\" height=\"340\" fill=\"gray\" fill-opacity=\"0.8\" />\n",
       "\n",
       "<rect x=\"1792.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"1812.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"1792.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"1812.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"1792.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"1812.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<circle cx=\"1892.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"1892.8\" cy=\"220.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"1892.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"1892.8\" cy=\"100.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"1892.8\" x2=\"1892.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"1852.8\" y=\"20.0\" width=\"80.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"1892.8\" y=\"36.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RY\n",
       " </text>\n",
       "<text x=\"1892.8\" y=\"52.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "1.0472\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"1952.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"1972.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"1952.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"1972.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"1952.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"1972.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<rect x=\"2012.8\" y=\"20.0\" width=\"0\" height=\"340\" fill=\"gray\" fill-opacity=\"0.8\" />\n",
       "\n",
       "<rect x=\"2012.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"2032.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"2012.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"2032.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<circle cx=\"2112.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"2112.8\" cy=\"220.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"2112.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"2112.8\" cy=\"100.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"2112.8\" x2=\"2112.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"2072.8\" y=\"20.0\" width=\"80.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"2112.8\" y=\"36.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RY\n",
       " </text>\n",
       "<text x=\"2112.8\" y=\"52.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "0.6797\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"2172.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"2192.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"2172.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"2192.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<rect x=\"2232.8\" y=\"20.0\" width=\"0\" height=\"340\" fill=\"gray\" fill-opacity=\"0.8\" />\n",
       "\n",
       "<rect x=\"2232.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"2252.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"2232.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"2252.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"2232.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"2252.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<circle cx=\"2332.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"2332.8\" cy=\"220.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"2332.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"2332.8\" cy=\"100.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"2332.8\" x2=\"2332.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"2292.8\" y=\"20.0\" width=\"80.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"2332.8\" y=\"36.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RY\n",
       " </text>\n",
       "<text x=\"2332.8\" y=\"52.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "0.5054\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"2392.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"2412.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"2392.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"2412.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"2392.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"2412.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<rect x=\"2452.8\" y=\"20.0\" width=\"0\" height=\"340\" fill=\"gray\" fill-opacity=\"0.8\" />\n",
       "\n",
       "<rect x=\"2452.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"2472.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"2452.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"2472.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<circle cx=\"2552.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"2552.8\" cy=\"220.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"2552.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"2552.8\" cy=\"100.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"2552.8\" x2=\"2552.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"2512.8\" y=\"20.0\" width=\"80.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"2552.8\" y=\"36.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RY\n",
       " </text>\n",
       "<text x=\"2552.8\" y=\"52.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "0.4027\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"2612.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"2632.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"2612.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"2632.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<rect x=\"2672.8\" y=\"20.0\" width=\"0\" height=\"340\" fill=\"gray\" fill-opacity=\"0.8\" />\n",
       "\n",
       "<rect x=\"2672.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"2692.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"2672.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"2692.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<circle cx=\"2772.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"2772.8\" cy=\"220.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"2772.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"2772.8\" cy=\"100.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"2772.8\" x2=\"2772.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"2732.8\" y=\"20.0\" width=\"80.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"2772.8\" y=\"36.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RY\n",
       " </text>\n",
       "<text x=\"2772.8\" y=\"52.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "0.3349\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"2832.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"2852.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"2832.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"2852.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<rect x=\"2892.8\" y=\"20.0\" width=\"0\" height=\"340\" fill=\"gray\" fill-opacity=\"0.8\" />\n",
       "\n",
       "<rect x=\"2892.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"2912.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<circle cx=\"2992.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"2992.8\" cy=\"220.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"2992.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"2992.8\" cy=\"100.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"2992.8\" x2=\"2992.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"2952.8\" y=\"20.0\" width=\"80.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"2992.8\" y=\"36.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RY\n",
       " </text>\n",
       "<text x=\"2992.8\" y=\"52.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "0.2867\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"3052.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"3072.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<rect x=\"3112.8\" y=\"20.0\" width=\"0\" height=\"340\" fill=\"gray\" fill-opacity=\"0.8\" />\n",
       "\n",
       "<rect x=\"3112.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"3132.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"3112.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"3132.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"3112.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"3132.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<circle cx=\"3212.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"3212.8\" cy=\"220.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"3212.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"3212.8\" cy=\"100.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"3212.8\" x2=\"3212.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"3172.8\" y=\"20.0\" width=\"80.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"3212.8\" y=\"36.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RY\n",
       " </text>\n",
       "<text x=\"3212.8\" y=\"52.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "0.2507\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"3272.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"3292.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"3272.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"3292.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"3272.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"3292.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<rect x=\"3332.8\" y=\"20.0\" width=\"0\" height=\"340\" fill=\"gray\" fill-opacity=\"0.8\" />\n",
       "\n",
       "<rect x=\"3332.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"3352.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"3332.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"3352.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<circle cx=\"3432.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"3432.8\" cy=\"220.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"3432.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"3432.8\" cy=\"100.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"3432.8\" x2=\"3432.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"3392.8\" y=\"20.0\" width=\"80.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"3432.8\" y=\"36.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RY\n",
       " </text>\n",
       "<text x=\"3432.8\" y=\"52.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "-0.2867\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"3492.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"3512.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"3492.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"3512.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<rect x=\"3552.8\" y=\"20.0\" width=\"0\" height=\"340\" fill=\"gray\" fill-opacity=\"0.8\" />\n",
       "\n",
       "<rect x=\"3552.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"3572.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"3552.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"3572.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<circle cx=\"3652.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"3652.8\" cy=\"220.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"3652.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"3652.8\" cy=\"100.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"3652.8\" x2=\"3652.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"3612.8\" y=\"20.0\" width=\"80.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"3652.8\" y=\"36.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RY\n",
       " </text>\n",
       "<text x=\"3652.8\" y=\"52.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "-0.3349\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"3712.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"3732.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"3712.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"3732.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<rect x=\"3772.8\" y=\"20.0\" width=\"0\" height=\"340\" fill=\"gray\" fill-opacity=\"0.8\" />\n",
       "\n",
       "<rect x=\"3772.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"3792.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<circle cx=\"3872.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"3872.8\" cy=\"220.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"3872.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"3872.8\" cy=\"100.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"3872.8\" x2=\"3872.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"3832.8\" y=\"20.0\" width=\"80.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"3872.8\" y=\"36.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RY\n",
       " </text>\n",
       "<text x=\"3872.8\" y=\"52.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "-0.4027\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"3932.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"3952.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<rect x=\"3992.8\" y=\"20.0\" width=\"0\" height=\"340\" fill=\"gray\" fill-opacity=\"0.8\" />\n",
       "\n",
       "<rect x=\"3992.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"4012.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"3992.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"4012.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<circle cx=\"4092.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"4092.8\" cy=\"220.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"4092.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"4092.8\" cy=\"100.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"4092.8\" x2=\"4092.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"4052.8\" y=\"20.0\" width=\"80.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"4092.8\" y=\"36.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RY\n",
       " </text>\n",
       "<text x=\"4092.8\" y=\"52.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "-0.5054\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"4152.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"4172.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"4152.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"4172.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<rect x=\"4212.8\" y=\"20.0\" width=\"0\" height=\"340\" fill=\"gray\" fill-opacity=\"0.8\" />\n",
       "\n",
       "<rect x=\"4212.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"4232.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<circle cx=\"4312.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"4312.8\" cy=\"220.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"4312.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"4312.8\" cy=\"100.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"4312.8\" x2=\"4312.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"4272.8\" y=\"20.0\" width=\"80.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"4312.8\" y=\"36.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RY\n",
       " </text>\n",
       "<text x=\"4312.8\" y=\"52.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "-0.6797\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"4372.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"4392.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<rect x=\"4432.8\" y=\"20.0\" width=\"0\" height=\"340\" fill=\"gray\" fill-opacity=\"0.8\" />\n",
       "\n",
       "<rect x=\"4432.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"4452.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<circle cx=\"4532.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"4532.8\" cy=\"220.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"4532.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"4532.8\" cy=\"100.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"4532.8\" x2=\"4532.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"4492.8\" y=\"20.0\" width=\"80.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"4532.8\" y=\"36.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RY\n",
       " </text>\n",
       "<text x=\"4532.8\" y=\"52.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "-1.0472\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"4592.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"4612.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "X\n",
       " </text>\n",
       "\n",
       "<rect x=\"4652.8\" y=\"20.0\" width=\"0\" height=\"340\" fill=\"gray\" fill-opacity=\"0.8\" />\n",
       "<circle cx=\"4672.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"4672.8\" cy=\"220.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"4672.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<circle cx=\"4672.8\" cy=\"100.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"4672.8\" x2=\"4672.8\" y1=\"40.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"4652.8\" y=\"20.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"4672.8\" y=\"36.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RY\n",
       " </text>\n",
       "<text x=\"4672.8\" y=\"52.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "-π\n",
       " </text>\n",
       "\n",
       "<rect x=\"4712.8\" y=\"20.0\" width=\"0\" height=\"340\" fill=\"gray\" fill-opacity=\"0.8\" />\n",
       "\n",
       "<rect x=\"4712.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"4732.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "H\n",
       " </text>\n",
       "\n",
       "<circle cx=\"4792.8\" cy=\"160.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"4792.8\" x2=\"4792.8\" y1=\"100.0\" y2=\"160.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"4772.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"4792.8\" y=\"96.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "PS\n",
       " </text>\n",
       "<text x=\"4792.8\" y=\"112.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "π/2\n",
       " </text>\n",
       "\n",
       "<circle cx=\"4852.8\" cy=\"220.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"4852.8\" x2=\"4852.8\" y1=\"100.0\" y2=\"220.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"4832.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"4852.8\" y=\"96.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "PS\n",
       " </text>\n",
       "<text x=\"4852.8\" y=\"112.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "π/4\n",
       " </text>\n",
       "\n",
       "<circle cx=\"4912.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"4912.8\" x2=\"4912.8\" y1=\"100.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"4892.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"4912.8\" y=\"96.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "PS\n",
       " </text>\n",
       "<text x=\"4912.8\" y=\"112.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "π/8\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"4952.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"4972.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "H\n",
       " </text>\n",
       "\n",
       "<circle cx=\"5032.8\" cy=\"220.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"5032.8\" x2=\"5032.8\" y1=\"160.0\" y2=\"220.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"5012.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"5032.8\" y=\"156.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "PS\n",
       " </text>\n",
       "<text x=\"5032.8\" y=\"172.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "π/2\n",
       " </text>\n",
       "\n",
       "<circle cx=\"5092.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"5092.8\" x2=\"5092.8\" y1=\"160.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"5072.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"5092.8\" y=\"156.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "PS\n",
       " </text>\n",
       "<text x=\"5092.8\" y=\"172.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "π/4\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"5132.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"5152.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "H\n",
       " </text>\n",
       "\n",
       "<circle cx=\"5212.8\" cy=\"280.0\" r=\"4\" fill=\"#fac209\" />\n",
       "<line x1=\"5212.8\" x2=\"5212.8\" y1=\"220.0\" y2=\"280.0\" stroke=\"#fac209\" stroke-width=\"3\" />\n",
       "<rect x=\"5192.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#fac209\" fill-opacity=\"1\" />\n",
       "<text x=\"5212.8\" y=\"216.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "PS\n",
       " </text>\n",
       "<text x=\"5212.8\" y=\"232.0\" font-size=\"14.0px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "π/2\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"5252.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"5272.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "H\n",
       " </text>\n",
       "\n",
       "<line x1=\"5332.8\" x2=\"5332.8\" y1=\"80.0\" y2=\"300.0\" stroke-width=\"3\" stroke=\"#16acff\" />\n",
       "\n",
       "<rect x=\"5312.8\" y=\"80.0\" width=\"40\" height=\"40\" rx=\"4\" ry=\"4\" fill=\"#16acff\" fill-opacity=\"1\" stroke=\"#ffffff\" stroke-width=\"0\" />\n",
       "<path d=\"M 5323.2 96.31384387633061 L 5328.0 88.0 L 5332.8 96.31384387633061 L 5329.4400000000005 96.31384387633061 L 5329.4400000000005 112.0 L 5326.56 112.0 L 5326.56 96.31384387633061 Z\" fill=\"#ffffff\" />\n",
       "<path d=\"M 5342.400000000001 103.68615612366939 L 5337.6 112.0 L 5332.8 103.68615612366939 L 5336.16 103.68615612366939 L 5336.16 88.0 L 5339.04 88.0 L 5339.04 103.68615612366939 Z\" fill=\"#ffffff\" />\n",
       "<rect x=\"5312.8\" y=\"260.0\" width=\"40\" height=\"40\" rx=\"4\" ry=\"4\" fill=\"#16acff\" fill-opacity=\"1\" stroke=\"#ffffff\" stroke-width=\"0\" />\n",
       "<path d=\"M 5323.2 276.3138438763306 L 5328.0 268.0 L 5332.8 276.3138438763306 L 5329.4400000000005 276.3138438763306 L 5329.4400000000005 292.0 L 5326.56 292.0 L 5326.56 276.3138438763306 Z\" fill=\"#ffffff\" />\n",
       "<path d=\"M 5342.400000000001 283.6861561236694 L 5337.6 292.0 L 5332.8 283.6861561236694 L 5336.16 283.6861561236694 L 5336.16 268.0 L 5339.04 268.0 L 5339.04 283.6861561236694 Z\" fill=\"#ffffff\" />\n",
       "<line x1=\"5392.8\" x2=\"5392.8\" y1=\"140.0\" y2=\"240.0\" stroke-width=\"3\" stroke=\"#16acff\" />\n",
       "\n",
       "<rect x=\"5372.8\" y=\"140.0\" width=\"40\" height=\"40\" rx=\"4\" ry=\"4\" fill=\"#16acff\" fill-opacity=\"1\" stroke=\"#ffffff\" stroke-width=\"0\" />\n",
       "<path d=\"M 5383.2 156.31384387633062 L 5388.0 148.0 L 5392.8 156.31384387633062 L 5389.4400000000005 156.31384387633062 L 5389.4400000000005 172.0 L 5386.56 172.0 L 5386.56 156.31384387633062 Z\" fill=\"#ffffff\" />\n",
       "<path d=\"M 5402.400000000001 163.68615612366938 L 5397.6 172.0 L 5392.8 163.68615612366938 L 5396.16 163.68615612366938 L 5396.16 148.0 L 5399.04 148.0 L 5399.04 163.68615612366938 Z\" fill=\"#ffffff\" />\n",
       "<rect x=\"5372.8\" y=\"200.0\" width=\"40\" height=\"40\" rx=\"4\" ry=\"4\" fill=\"#16acff\" fill-opacity=\"1\" stroke=\"#ffffff\" stroke-width=\"0\" />\n",
       "<path d=\"M 5383.2 216.31384387633062 L 5388.0 208.0 L 5392.8 216.31384387633062 L 5389.4400000000005 216.31384387633062 L 5389.4400000000005 232.0 L 5386.56 232.0 L 5386.56 216.31384387633062 Z\" fill=\"#ffffff\" />\n",
       "<path d=\"M 5402.400000000001 223.68615612366938 L 5397.6 232.0 L 5392.8 223.68615612366938 L 5396.16 223.68615612366938 L 5396.16 208.0 L 5399.04 208.0 L 5399.04 223.68615612366938 Z\" fill=\"#ffffff\" />\n",
       "<circle cx=\"5432.8\" cy=\"280.0\" r=\"4\" fill=\"#5e7ce0\" />\n",
       "<line x1=\"5432.8\" x2=\"5432.8\" y1=\"280.0\" y2=\"340.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" />\n",
       "<rect x=\"5372.8\" y=\"320.0\" width=\"120.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"5432.8\" y=\"340.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RZ(π/2)^1\n",
       " </text>\n",
       "\n",
       "<circle cx=\"5572.8\" cy=\"220.0\" r=\"4\" fill=\"#5e7ce0\" />\n",
       "<line x1=\"5572.8\" x2=\"5572.8\" y1=\"220.0\" y2=\"340.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" />\n",
       "<rect x=\"5512.8\" y=\"320.0\" width=\"120.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"5572.8\" y=\"340.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RZ(π/2)^2\n",
       " </text>\n",
       "\n",
       "<circle cx=\"5712.8\" cy=\"160.0\" r=\"4\" fill=\"#5e7ce0\" />\n",
       "<line x1=\"5712.8\" x2=\"5712.8\" y1=\"160.0\" y2=\"340.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" />\n",
       "<rect x=\"5652.8\" y=\"320.0\" width=\"120.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"5712.8\" y=\"340.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RZ(π/2)^4\n",
       " </text>\n",
       "\n",
       "<circle cx=\"5852.8\" cy=\"100.0\" r=\"4\" fill=\"#5e7ce0\" />\n",
       "<line x1=\"5852.8\" x2=\"5852.8\" y1=\"100.0\" y2=\"340.0\" stroke=\"#5e7ce0\" stroke-width=\"3\" />\n",
       "<rect x=\"5792.8\" y=\"320.0\" width=\"120.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"5852.8\" y=\"340.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "RZ(π/2)^8\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"5932.8\" y=\"260.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"5952.8\" y=\"280.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "H\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"5932.8\" y=\"200.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"5952.8\" y=\"220.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "H\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"5932.8\" y=\"140.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"5952.8\" y=\"160.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "H\n",
       " </text>\n",
       "\n",
       "\n",
       "<rect x=\"5932.8\" y=\"80.0\" width=\"40.0\" height=\"40\" rx=\"4\" ry=\"4\" stroke=\"#ffffff\" stroke-width=\"0\" fill=\"#5e7ce0\" fill-opacity=\"1\" />\n",
       "<text x=\"5952.8\" y=\"100.0\" font-size=\"20px\" dominant-baseline=\"middle\" text-anchor=\"middle\" font-family=\"Arial\" font-weight=\"normal\" fill=\"#ffffff\" >\n",
       "H\n",
       " </text>\n",
       "\n",
       "</svg></div>"
      ],
      "text/plain": [
       "<mindquantum.io.display.circuit_svg_drawer.SVGCircuit at 0x7f13e3ed3f40>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from mindquantum.algorithm.library import qft\n",
    "\n",
    "# q1 ~ q4 : for QPE \n",
    "t = 4\n",
    "qc = [4, 3, 2, 1]\n",
    "\n",
    "# store |b> , and store the result |x>\n",
    "qb = 5\n",
    "\n",
    "# use for conditional rotation\n",
    "qs = 0\n",
    "\n",
    "# choose a time evolution\n",
    "dt = np.pi / 4\n",
    "\n",
    "# choose a small C\n",
    "C = 0.5\n",
    "\n",
    "circ = Circuit()\n",
    "\n",
    "# prepare b\n",
    "circ += RY(2 * np.arcsin(0.8)).on(qb)\n",
    "\n",
    "# QPE\n",
    "for i in qc:\n",
    "    circ += H.on(i)\n",
    "\n",
    "for (i, q) in enumerate(qc):\n",
    "    circ += Power(RZ(-2 * dt), 2**i).on(qb, q) \n",
    "\n",
    "# apply inverse QFT\n",
    "circ += qft(list(reversed(qc))).hermitian()\n",
    "\n",
    "# conditional rotate\n",
    "circ += BARRIER\n",
    "for k in range(1, 2**t):\n",
    "    for i in range(t):\n",
    "        if (k & (1 << i)) == 0:\n",
    "            circ += X.on(qc[i])\n",
    "    \n",
    "    phi = k / (2**t)\n",
    "    if k > 2**(t-1):\n",
    "        phi -= 1.0\n",
    "    l = 2 * np.pi / dt * phi\n",
    "    circ += RY(2 * np.arcsin(C / l)).on(qs, qc)\n",
    "\n",
    "    for i in range(t):\n",
    "        if (k & (1 << i)) == 0:\n",
    "            circ += X.on(qc[i])\n",
    "    circ += BARRIER\n",
    "\n",
    "# apply inverse QPE\n",
    "circ += qft(list(reversed(qc)))\n",
    "\n",
    "for (i, q) in enumerate(qc):\n",
    "    circ += Power(RZ(2 * dt), 2**i).on(qb, q)\n",
    "\n",
    "for i in qc:\n",
    "    circ += H.on(i)\n",
    "\n",
    "circ.svg()"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "如何验证我们的结果的正确性？第一种方式是测量，因为结果是量子态 $|x\\rangle$，目前 MindQuantum 没有相关的办法能够单独取出某一个量子比特的内部值，我们只能通过测量。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<div class=\"nb-html-output output_area\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"408.4\" height=\"207.0\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<rect x=\"0\" y=\"0\" width=\"408.4\" height=\"207.0\" fill=\"#ffffff\" />\n",
       "<text x=\"10\" y=\"17.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" >\n",
       "Shots:\n",
       " 100000\n",
       " </text>\n",
       "<text x=\"10\" y=\"31.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" >\n",
       "Keys: q5 q0\n",
       " </text>\n",
       "<line x1=\"38.4\" x2=\"398.4\" y1=\"62.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" />\n",
       "<line x1=\"38.4\" x2=\"38.4\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" />\n",
       "<text x=\"40.4\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >\n",
       "0.0\n",
       " </text>\n",
       "<line x1=\"38.4\" x2=\"38.4\" y1=\"62.0\" y2=\"197.0\" stroke=\"#adb0b8\" stroke-width=\"1\" />\n",
       "<line x1=\"98.4\" x2=\"98.4\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" />\n",
       "<text x=\"100.4\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >\n",
       "0.096\n",
       " </text>\n",
       "<line x1=\"98.4\" x2=\"98.4\" y1=\"62.0\" y2=\"197.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" />\n",
       "<line x1=\"158.4\" x2=\"158.4\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" />\n",
       "<text x=\"160.4\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >\n",
       "0.191\n",
       " </text>\n",
       "<line x1=\"158.4\" x2=\"158.4\" y1=\"62.0\" y2=\"197.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" />\n",
       "<line x1=\"218.4\" x2=\"218.4\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" />\n",
       "<text x=\"220.4\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >\n",
       "0.287\n",
       " </text>\n",
       "<line x1=\"218.4\" x2=\"218.4\" y1=\"62.0\" y2=\"197.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" />\n",
       "<line x1=\"278.4\" x2=\"278.4\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" />\n",
       "<text x=\"280.4\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >\n",
       "0.383\n",
       " </text>\n",
       "<line x1=\"278.4\" x2=\"278.4\" y1=\"62.0\" y2=\"197.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" />\n",
       "<line x1=\"338.4\" x2=\"338.4\" y1=\"55.0\" y2=\"62.0\" stroke=\"#adb0b8\" stroke-width=\"1\" />\n",
       "<text x=\"340.4\" y=\"60.0\" font-size=\"12px\" dominant-baseline=\"bottom\" text-anchor=\"start\" fill=\"#575d6c\" >\n",
       "0.479\n",
       " </text>\n",
       "<line x1=\"338.4\" x2=\"338.4\" y1=\"62.0\" y2=\"197.0\" stroke=\"#dfe1e6\" stroke-width=\"1\" />\n",
       "<text x=\"29.4\" y=\"85.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >\n",
       "00\n",
       " </text>\n",
       "<line x1=\"31.4\" x2=\"38.4\" y1=\"85.0\" y2=\"85.0\" stroke=\"#adb0b8\" stroke-width=\"1\" />\n",
       "<rect x=\"38.4\" y=\"73.0\" width=\"170.03594265892087\" height=\"24\" id=\"bar_0_1685178522522723232\" fill=\"#5e7ce0\" />\n",
       "<text x=\"218.43594265892088\" y=\"85.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_0_1685178522522741263\" fill-opacity=\"0\" >\n",
       "27123\n",
       " </text>\n",
       "<text x=\"29.4\" y=\"115.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >\n",
       "01\n",
       " </text>\n",
       "<line x1=\"31.4\" x2=\"38.4\" y1=\"115.0\" y2=\"115.0\" stroke=\"#adb0b8\" stroke-width=\"1\" />\n",
       "<rect x=\"38.4\" y=\"103.0\" width=\"56.45923015839847\" height=\"24\" id=\"bar_1_1685178522522759007\" fill=\"#16acff\" />\n",
       "<text x=\"104.85923015839847\" y=\"115.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_1_1685178522522770008\" fill-opacity=\"0\" >\n",
       "9006\n",
       " </text>\n",
       "<text x=\"29.4\" y=\"145.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >\n",
       "10\n",
       " </text>\n",
       "<line x1=\"31.4\" x2=\"38.4\" y1=\"145.0\" y2=\"145.0\" stroke=\"#adb0b8\" stroke-width=\"1\" />\n",
       "<rect x=\"38.4\" y=\"133.0\" width=\"300.00000000000006\" height=\"24\" id=\"bar_2_1685178522522784351\" fill=\"#5e7ce0\" />\n",
       "<text x=\"348.40000000000003\" y=\"145.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_2_1685178522522798760\" fill-opacity=\"0\" >\n",
       "47854\n",
       " </text>\n",
       "<text x=\"29.4\" y=\"175.0\" font-size=\"12px\" dominant-baseline=\"middle\" text-anchor=\"end\" fill=\"#575d6c\" >\n",
       "11\n",
       " </text>\n",
       "<line x1=\"31.4\" x2=\"38.4\" y1=\"175.0\" y2=\"175.0\" stroke=\"#adb0b8\" stroke-width=\"1\" />\n",
       "<rect x=\"38.4\" y=\"163.0\" width=\"100.41166882601246\" height=\"24\" id=\"bar_3_1685178522522812516\" fill=\"#16acff\" />\n",
       "<text x=\"148.81166882601246\" y=\"175.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"start\" fill=\"#575d6c\" id=\"bar_text_3_1685178522522822102\" fill-opacity=\"0\" >\n",
       "16017\n",
       " </text>\n",
       "<animate xlink:href=\"#bar_0_1685178522522723232\" attributeName=\"width\" from=\"0\" to=\"170.03594265892087\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 170.03594265892087\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" />\n",
       "<animate xlink:href=\"#bar_1_1685178522522759007\" attributeName=\"width\" from=\"0\" to=\"56.45923015839847\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 56.45923015839847\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" />\n",
       "<animate xlink:href=\"#bar_2_1685178522522784351\" attributeName=\"width\" from=\"0\" to=\"300.00000000000006\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 300.00000000000006\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" />\n",
       "<animate xlink:href=\"#bar_3_1685178522522812516\" attributeName=\"width\" from=\"0\" to=\"100.41166882601246\" dur=\"0.3s\" calcMode=\"spline\" values=\"0; 100.41166882601246\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" />\n",
       "<animate xlink:href=\"#bar_2_1685178522522784351\" attributeName=\"fill\" from=\"#5e7ce0\" to=\"#fac209\" dur=\"0.15s\" calcMode=\"spline\" values=\"#5e7ce0; #fac209\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" />\n",
       "<animate xlink:href=\"#bar_text_0_1685178522522741263\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" />\n",
       "<animate xlink:href=\"#bar_text_1_1685178522522770008\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" />\n",
       "<animate xlink:href=\"#bar_text_2_1685178522522798760\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" />\n",
       "<animate xlink:href=\"#bar_text_3_1685178522522822102\" attributeName=\"fill-opacity\" from=\"0\" to=\"1\" dur=\"0.15s\" calcMode=\"spline\" values=\"0; 1\" keyTimes=\"0; 1\" keySplines=\"0.42 0 1 0.8;\" fill=\"freeze\" begin=\"0.3s\" />\n",
       "<text x=\"206.7\" y=\"41.0\" font-size=\"14px\" dominant-baseline=\"middle\" text-anchor=\"middle\" >\n",
       "probability\n",
       " </text>\n",
       "</svg></div>"
      ],
      "text/plain": [
       "<mindquantum.io.display.measure_res_svg_drawer.SVGMeasure at 0x7f144c64acd0>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sim = Simulator(backend=\"mqvector\", n_qubits=2 + t)\n",
    "sim.apply_circuit(circ)\n",
    "\n",
    "circ_m = Circuit()\n",
    "circ_m += Measure().on(qs)\n",
    "circ_m += Measure().on(qb)\n",
    "\n",
    "res = sim.sampling(circ_m, shots=100000)\n",
    "res.svg()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.35990888382687924"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "res.data.get(\"01\", 0) / (res.data.get(\"01\", 0) + res.data.get(\"11\", 0))"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "通过统计当 `q0` 是 1 时，`q5` 的测量结果，我们看到 `q5 = 0` 的占比是 `0.36`，和答案的预期一致。\n",
    "\n",
    "当然这种方法只能得到振幅大小，想要得到更多信息，例如相位，需要对测量进行调整，这里不去讨论。"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "当然还有一种比较笨的方法，虽然我们不能通过 MindQuantum 得到单独某一个量子比特的内部信息，但是可以得到整体的量子态信息，可以一步步构建出预期的量子态，然后和 MindQuantum 进行对比。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# After QPE\n",
    "# 只在 QPE 就结束\n",
    "\n",
    "u1 = np.array([1, 0]) # |0>\n",
    "u2 = np.array([0, 1]) # |1>\n",
    "zero = np.array([1, 0])\n",
    "one = np.array([0, 1])\n",
    "phi1 = np.kron(zero, np.kron(one, np.kron(zero, zero))) # |0100>\n",
    "phi2 = np.kron(zero, np.kron(one, np.kron(one, one))) # |0111>\n",
    "\n",
    "exp = 0.6 * np.kron(u1, np.kron(phi1, zero)) + 0.8 * np.kron(u2, np.kron(phi2, zero))\n",
    "\n",
    "# state = sim.get_qs()\n",
    "# np.allclose(exp, state)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# After Rotate\n",
    "# 在条件旋转后结束\n",
    "\n",
    "u1 = np.array([1, 0]) # |0>\n",
    "u2 = np.array([0, 1]) # |1>\n",
    "zero = np.array([1, 0])\n",
    "one = np.array([0, 1])\n",
    "phi1 = np.kron(zero, np.kron(one, np.kron(zero, zero))) # |0100>\n",
    "phi2 = np.kron(zero, np.kron(one, np.kron(one, one))) # |0111>\n",
    "\n",
    "exp = 0.6 * np.kron(u1, np.kron(phi1, np.sqrt(1 - C**2) * zero + C * one)) \\\n",
    "    + 0.8 * np.kron(u2, np.kron(phi2, np.sqrt(1 - C**2) * zero - C * one))\n",
    "\n",
    "# state = sim.get_qs()\n",
    "# np.allclose(exp, state)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Finally\n",
    "# 最终的期望量子态\n",
    "\n",
    "u1 = np.array([1, 0]) # |0>\n",
    "u2 = np.array([0, 1]) # |1>\n",
    "zero = np.array([1, 0])\n",
    "one = np.array([0, 1])\n",
    "phi0 = np.kron(zero, np.kron(zero, np.kron(zero, zero)))\n",
    "\n",
    "# 期望值\n",
    "exp = 0.6 * np.kron(u1, np.kron(phi0, np.sqrt(1 - C**2) * zero + C * one)) \\\n",
    "    + 0.8 * np.kron(u2, np.kron(phi0, np.sqrt(1 - C**2) * zero - C * one))\n",
    "\n",
    "# 实际值\n",
    "state = sim.get_qs()\n",
    "# 对比\n",
    "np.allclose(exp, state)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "mq_cpu",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.16"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
